<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['算法管理','算法标定[30S]']" icon="fa fa-subscript" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<div class="s_table" style="margin-bottom: 24px;">
		<h3 class="s_table_title"><span class="verticalLine">&nbsp;</span>算法标定[30S]</h3>
		<div class="page-header clearfix s_table_opreation">
			<div class="left page-header-btn">
				<div class="top_module">
					<span class="module_text">公司名称</span>
					<sa-company-tree companyTreeId="companyTree" wrap="body" (companySelected)="companySelected($event)"></sa-company-tree>                     
				</div> 
				<div class="top_module">
					<span class="module_text">车牌号码
					</span><div class="company_tree" id="carTreeId">
						<div class="clearfix" style="position: relative;">
							<div class="s_hover_box s_fix_radius">
								<input class="form-control tree_company_input" id="car_input" autocomplete='off'
									 [(ngModel)]='carNumbers' (click)="carClick()" onfocus="this.blur()" type="text" placeholder="请选择" />
								<div class="s_del_icon" id="carNumbers_clear" (click)='delCarText()'>x</div>
							</div>
							<div class="s_tree_box" id="s_car_tree_box">
								<div class="treeSearchInputBox">
									<input type="text" class="treeSearchInput" id="cartreeSearchInput" (input)="carSearch()" placeholder="关键字"/>
								</div>
								<div class="vision_tree" id="vision_tree" style="height: calc(100% - 54px);">
									<div class="carTree" id="carTree"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!--<div class="top_module">
					<span class="module_text">标定方式</span>
					<select class="module_inp" style="" [(ngModel)]="calibrationType">
						<option value="1">散装水泥车[PQY]</option>
						<option value="2">袋装水泥车[PQY]</option>
					</select>
				</div>-->
				<div class="top_module">
					<span class="module_text">表类型</span>
					<select class="module_inp" style="" [(ngModel)]="tableType" (change)="tableTypeSelected($event.target.value)">
						<option value="0">默认</option>
						<!-- <option value="1">临时表</option> -->
					</select>
				</div>
				<div class="top_module">
					<span class="module_text">地磅数据区间</span>
					<select class="module_inp" style="" [(ngModel)]="weightRangeTime">
						<option value="5">近五天</option>
						<option value="30">近一个月</option>
						<option value="60">近两个月</option>
						<option value="90">近三个月</option>
					</select>
				</div>
				<div class="top_module" style="min-width: auto;">
					<span class="module_text">地磅数据</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='weightCount' >
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>
						<option value="13">13</option>
						<option value="14">14</option>
						<option value="15">15</option>
					</select>
				</div>
				
				<div class="top_module form-group">
					<span class="module_text">时间区间 前[小时]：</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='beforeTime'>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
					</select>
				</div>
				
				<div class="top_module form-group">
					<span class="module_text">时间区间 后[小时]</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='afterTime'>
						<option value="0">0</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
					</select>
				</div>
				<button type="button" class="btn btn-primary" (click)="calculation()">保存</button>
			</div>
		</div>
	</div>
	<!--表格头部操作部分end-->
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>标定结果</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<sa-company-tree-car companyTreeId="companyTree2" (companySelected)="companySelected2($event)"></sa-company-tree-car>
								<div class="top_module">
									<span class="module_text">标定方式</span>
									<select class="module_inp" style="" [(ngModel)]="Ttype" style="width: 130px;">
										<option value="">全部</option>
										<option value="1">散装水泥车[PQY]</option>
										<option value="2">袋装水泥车[PQY]</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">标定状态</span>
									<select class="module_inp" style="" [(ngModel)]="Tstatus" style="width: 120px;">
										<option value="">全部</option>
										<option value="0">未标定</option>
										<option value="1">标定成功</option>
										<option value="2">标定失败</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button class="btn btn-primary" (click)="exprotData()">导出</button>
								<button class="btn btn-primary" (click)="auto_calculation()">自动标定</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="公司、车牌号、操作人...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备编码</th>
										<th>车牌号码</th>
										<th>公司名称</th>
										<th>标定状态</th>
										<th>下发系数</th>
										<th>传感器通道</th>
										<th>标定类型</th>
										<th>地磅数据</th>
										<th>时间区间前[小时]</th>
										<th>时间区间后[小时]</th>
										<th>设置时间</th>
										<th>应答时间</th>
										<th>数据表类型</th>
										<th>创建时间</th>
										<th>更新时间</th>
										<th>操作人</th>
										<th>备注</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.companyName}}</td>
										<td>
											<span  class="" *ngIf="row.status == '0'">未标定</span>
											<span  class="green" *ngIf="row.status == '1'">标定成功</span>
											<span  class="red" *ngIf="row.status == '2'">标定失败</span>
										</td>
										<td>
											<span *ngIf='row.coefT.length >0'>
												<span>[</span><span *ngFor="let lis of row.coefT;let i = index;">
													<span style="font-weight: bold;">CH{{lis.index}}:</span><span>{{lis.value}}<span *ngIf="i < row.coefT.length-1">,</span></span>
												</span><span>]</span>
											</span>
										</td>
										<td><span class="channel-style bg-green" *ngFor="let item of row.sensorStatus;let index = index;" [style.display]="item!=0?'none':'inline-block'" >{{index+1}}</span></td>
										<td>
											<span  class="" *ngIf="row.type == '1'">散装水泥车[PQY]</span>
											<span  class="" *ngIf="row.type == '2'">袋装水泥车[PQY]</span>
										</td>
										<td>{{row.weightNum}}</td>
										<td>{{row.beforeTime}}</td>
										<td>{{row.afterTime}}</td>
										<td>{{row.sendTime}}</td>
										<td>{{row.ackTime}}</td>
										<td>
											<span  class="" *ngIf="row.tableType == '0'">默认表数据</span>
											<span  class="" *ngIf="row.tableType == '1'">临时表数据 </span>
										</td>
										<td>{{row.createTime}}</td>
										<td>{{row.updateTime}}</td>
										<td>{{row.userName}}</td>
										<td>{{row.remark}}</td>
										<td>
											<button type="button" (click)="delRow(row)">刪除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>